@extends('akl.Admin.Base-index')
@section('content')
<script>
	$('#left-bar .nav>li:nth-child(2)>.menu').addClass('on');
</script>
<div class="main-menu fadeInLeft">
	<div class="title">
		<i class="fa fa-file-text-o"></i> 用户管理
	</div>
	<ul class="act-list">
		<li>
			<a href="/Admin/User/create"><i class="fa fa-plus-square-o"></i>添加员工</a>
		</li>
	</ul>
</div>
<div class="main-wrap fadeInRight">
	<div style="color: red">
		<?php if (!is_object($errors)) print_r($errors); ?>
	</div>
	<table class="tablePanel">
		<tr>
	        <th>用户名</th>
	        <th>角色</th>
	        <th>状态</th>
	        <th>操作</th>
	    </tr>
		@foreach($users as $sort)
			<tr>
				<td>{{$sort->name}}</td>
				<td>{{$sort->rname}}</td>
				<td>
					@if($sort->active==0)
						正常
					@else
						禁用
					@endif
				</td>
				<td>
					@if($sort->roles_id!=1)
						<a href="javascript:if(confirm('确实要删除吗?'))location='/Admin/User/destroy/id/{{$sort->id}}'">删除</a>
						<a class="act-btn" href="/Admin/User/edit/id/{{$sort->id}}">编辑</a></td>
					@endif

			</tr>
		@endforeach
	</table>
	<div class="pagenav">
		{{ $users->links() }}
	</div>
</div>
@endsection
